# Copyright 2024 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
from llava_dataloader import LlavaDataLoader
from mindformers import MindFormerConfig
from llava_transform import LlavaTransform
from llava_dataset import LlavaDataset

config = MindFormerConfig("/home/zhangyouwen/suite/mobile_commucation/mindformers/research/llava/run_llava.yaml")

llava_dataset = LlavaDataset(dataset_config=config.train_dataset)

for item in llava_dataset:
    print(item)
    pass

llava_dataoader = LlavaDataLoader(
    dataset_dir="/home/zhangyouwen/suite/mobile_commucation/data/",
    text_file="llava_v1_5_mix665k.json",
    file_format="json",
    column_names=["image", "text"],
    shuffle=True,
    image_size=336
)



for item in llava_dataoader:
    print(item)
    pass